@extends('layouts.app')


@section('content')

<div class="container">
    <div class="row content-center">

        <div class="col-3">
            @include('components.user_left')
        </div>

        <div class="col-9">

            <div class="card" style="word-wrap: normal;">
                <div class="card-header">
                    直播设置
                </div>
                <div class="card-body">
                    <div class="card-body alert-warning">
                        <blockquote class="blockquote mb-0 ">
                            <p>为了用户体验，希望主播在未开播状态下，关闭主播间。</p>
                            <footer class="blockquote-footer">不会视频直播请看<cite title="Source Title"><a href="{{'../help'}}">《视频直播使用帮助》</a></cite></footer>
                        </blockquote>
                    </div>
                    <br>

					@if ($errors->any())
						<div class="alert alert-danger" role="alert">
							<ul>
								@foreach ($errors->all() as $error)
									<li>{{ $error }}</li>
								@endforeach
							</ul>
						</div>
					@endif

                    @if (session('msg'))
                        <div class="alert alert-success" role="alert">
                            {{ session('msg') }}
                        </div>
                    @endif

                    <form method="post" action="updateLive" enctype="multipart/form-data">
                        @csrf
                        <div class="form-group row">
                            <label class="col-sm-2 col-form-label">直播间地址</label>
                            <div class="col-sm-10 col-form-label">
                                <label><a href="{{url("/liveRoom/".auth::user()->id) }}">{{url("/liveRoom/".auth::user()->id)}}</a></label>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label for="staticEmail" class="col-sm-2 col-form-label">标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="title" value="{{$live->title}}">
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-2 col-form-label">直播间封面</label>
                            <div class="col-sm-10 col-form-label">
                                ​<img src="{{ asset($live->img)}}" class="img-fluid img-thumbnail" alt="...">
                                {{--<figure class="figure">--}}
                                    {{--<img src="https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1550647602&di=d659f970d796f8e996f4200226a5775c&src=http://img.zcool.cn/community/01ffe85983c6c8a80121560317ec3c.jpg" class="figure-img img-fluid rounded" alt="A generic square placeholder image with rounded corners in a figure.">--}}
                                    {{--<figcaption class="figure-caption text-right">点击修改图片.</figcaption>--}}
                                {{--</figure>--}}


                                <div class="custom-file">
                                    <input type="file"  class="custom-file" name="img"  value="">
                                </div>

                            </div>

                        </div>

                        <div class="form-group row">
                            <label for="staticEmail" class="col-sm-2 col-form-label">直播栏目</label>
                            <div class="col-sm-10">
                                <div class="input-group">
                                    <select class="custom-select" name="type_id" id="inputGroupSelect04">
                                        <option value="0" >--请选择栏目--</option>
                                        @foreach($type_list as $type)
                                        <option value="{{$type->type_id}}" @if ($live->type_id === $type->type_id) selected @endif >{{$type->name}}</option>
                                        @endforeach

                                    </select>
                                    {{--<div class="input-group-append">--}}
                                        {{--<button class="btn btn-primary" type="button">修改</button>--}}
                                    {{--</div>--}}
                                </div>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-2 col-form-label">是否开播</label>
                            <div class="col-sm-10 col-form-label">
                                <div class="custom-control custom-radio custom-control-inline">
                                    <input type="radio" id="is_play1" name="is_play" class="custom-control-input" value="1" @if ($live->is_play === 1) checked @endif >
                                    <label class="custom-control-label" for="is_play1">开启直播</label>
                                </div>
                                <div class="custom-control custom-radio custom-control-inline">
                                    <input type="radio" id="is_play2" name="is_play" class="custom-control-input" value="0" @if ($live->is_play === 0) checked @endif >
                                    <label class="custom-control-label" for="is_play2">关闭直播</label>
                                </div>

                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="staticEmail" class="col-sm-2 col-form-label">推流地址</label>
                            <div class="col-sm-10">
                                <input type="text" readonly class="form-control" disabled value="rtmp://106.12.22.78:1935/hls/{{$live->flow_name}}">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="staticEmail" class="col-sm-2 col-form-label">流&nbsp;&nbsp;名&nbsp;&nbsp;称</label>
                                <div class="col-sm-10">
                                    <div class="input-group mb-3">
                                        <input type="text" class="form-control" readonly value="{{$live->flow_name}}" >
                                        <div class="input-group-append">
                                            <button class="btn btn-primary" type="button">更换</button>
                                        </div>
                                    </div>
                                </div>
                        </div>

                        <div class="form-group row">
                            <label for="" class="col-sm-2 col-form-label"></label>
                            <div class="col-sm-10">
                                <input type="hidden" name="user_id" value="{{Auth::user()->id}}">
                                <button type="submit" class="btn btn-primary mb-2">提交</button>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>

    </div>



@endsection



